set vAztecList=value(the text of field "AztecLinks")
sort vAztecList
set vEgyptList= value(the text of field "EgyptLinks")
Sort vEgyptList
set vVikingList= value(the text of field "VikingLinks")
Sort vVikingList
set vMasterList= value(the text of field "MasterLinks")
sort vMasterList
set iMainMovieList=["A":"AztecW", "E":"EgyptW","V":"VikingW"]
set iExitList=["A":vAztecList, "E":vEgyptList,"V":vVikingList,"M":vMasterList]
sort iExitList
set iButtonWorld="None"
set iLevToJump=0
return me
end birth
on mLeaveToToc me, pChipName
-- CALLED WHEN USER CLICKS ON A TABLE OF CONTENTS CHIP TO TAKE USER TO CONTENT
set vLevel=mgetlevel(ogame)
if vLevel<4 then
set vListName=char 1 of the moviename
else
set vListName="M"
end if
set vActiveLocList=getaprop(iExitList, vListName)
delete char 1 to 4 of pChipName
set vJumpCommand=getaprop(vActiveLocList, pChipName)
if vLevel<4 then
set gWhatMovie=getaprop(iMainMovielist, vListName)
else
set gWhatMovie=getaprop(iMainMovielist, (char 1 of pChipName))
end if
if not(((vJumpcommand contains "Time") and (vJumpCommand<>"MeasuringTime")) or (vJumpcommand contains "BasicFacts") or(vJumpcommand contains "Map")) then --APN 7/19
put "Cross" after vJumpCommand
else
-- KLUGE FOR TIMELINE QUESTION
-- (Level 4, question 50 -- goes to timeline of world you are in)
-- ALL OTHER MASTER QUESTIONS ARE IDENTICAL IN ALL THREE WORLDS
if (vJumpCommand contains "Time") and (mgetlevel(oGame)=4) then
put char 1 of the moviename into char 1 of vJumpCommand
end if
end if
put "Here's gWhatMovie:"&gWhatMovie
put "Here's vJumpCommand:"&vJumpCommand
do vJumpCommand
end mLeaveToToc
on mEndMovieExit me
set oGame=0
set oLastGame=0
set vListName=char 1 of the moviename
set gWhatMovie=getaprop(iMainMovielist, vListName)
TableCross
end mEndMovieExit
on mRollLevels me
set vClicked=false
set vPoint=point(the mouseh, the mousev)
if the stilldown then
set iLevToJump=(the frame-marker(0))-1
else
-- ELSE THE MOUSE IS UP
-- IF A LEVEL HAS BEEN CHOSEN
if iLevToJump>0 then
set vClicked=true
-- process response
-- IF THE CHOICE WAS ANYTHING OTHER THAN CANCEL
if iLevToJump<5 then
if objectp(oGame) then
mFlushChips(oGame) --APN 7/19
set oGame=0
end if
if objectp(oLastGame) then --APN 7/19
mFlushChips(oLastGame)
set oLastGame=0
end if
mStartGame(me, iLevtoJump)
set iLevToJump=0
else
-- USER HAS CHOSEN CANCEL
-- IF A GAME IN PROGRESS
if objectp(oLastGame) then
set oGame=oLastGame
set oLastGame=0
-- IF THE GAME IN PROGRESS IS IN ANOTHER WORLD
if char 1 of the moviename<>mGetWorld(oGame) then
--put "other"
turnoffpuppets 1 --APN 7/19
put "Going to movie:"&mGetWorld(oGame)
go movie (mGetWorld(oGame)&"Game.DIR")
makegamebuttons me, (char 1 of the moviename)
else
-- ELSE THE GAME IN PROGRESS IS IN THE CURRENT WORLD
--put "current"
makegamebuttons me, (char 1 of the moviename)
go label("Chips")
mresumegame(oGame)
end if
else
-- NO GAME IS IN PROGRESS RETURN TO CONTENT
-- cancel is being called w/out an existing last game
leavegame
end if
end if
-- if a choice has been made clear out this object's LEVEL setting
set iLevToJump=0
end if
end if
-- IF NO CHOICE HAS BEEN MADE, THEN KEEP CYCLING FRAMES
set vWheretojump=mFindRectInList(me, vPoint, iLevelRects)
if vWhereToJump then
HandCursor
else
ArrowCursor
end if
if not(vClicked) then go frame(marker(0)+vWhereToJump+1)
end mRollLevels
on mFindRectInList me, pPoint, pRectList
set vFound=false
set vIndex=0
set vListLen=count(pRectList)
repeat while vFound=0 and vIndex<vListLen
set vIndex=vIndex+1
set vFound=inside(pPoint, getat(pRectList, vIndex))
end repeat
return vFound*vIndex
end mFindRectList
on mQuestionRoll me
if not(rollover(43)) then
if hilight(gAnsA) then exit
if hilight(gAnsB) then exit
if hilight(gAnsC) then exit
end if
arrowcursor
--if hilight(gGameBtn4) then exit
end mQuestionRoll
on mRestartRoll me
if hilight(gGameBtn5) then exit
if hilight(gGameBtn6) then exit
arrowcursor
end mRestartRoll
on mChipRoll me
-- must call into oGame to get chips
if ((the mouseh<85) and (the mousev>290)) or (the mousev<70) then
if hilight(gGameBtn1) then exit
if hilight(gGameBtn2) then exit
if hilight(gGameBtn3) then exit
if objectp(gBtn16) then
if hilight(gBtn16) then exit
end if
if objectp(gBtn17) then
if hilight(gBtn17) then exit
end if
if objectp(gBtn18) then
if hilight(gBtn18) then exit
end if
else
set vButList=mgetChipList(oGame)
set vLIstLen=count(vButList)
set vChipNum=0
set vFound=False
repeat while ((vFound=false) and (vChipNum<vListLen))
set vChipNum=vChipNum+1
if hilight(getat(vButList, vChipNum)) then
set vFound=true
exit
end if
end repeat
end if
arrowcursor
end mChipRoll
on mGIPRoll me
if hilight(gGameBtn7) then exit
if hilight(gGameBtn8) then exit
end mGIPRoll
on mKillGIP me
watchcursor
hidecontrol(gGameBtn7)
hidecontrol(gGameBtn8)
makegamebuttons me, (char 1 of the moviename)
set oGame=0
go frame "Level"
end mKillGIP
on mExitToGIP me
hidecontrol(gGameBtn7)
hidecontrol(gGameBtn8)
set vMovieExitScript=mGetWorld(oGame)&"GAME"
do vMovieExitScript
end mExitToGIP
on mEnterGame me
watchcursor
if objectp(oGame) then -- if a game in progress
if mgetworld(oGame)=char 1 of the moviename then -- if existing game is in this world
-- you are resuming a game in the same world
go frame "Chips"
mResumeGame(oGame)
put "mresuming a game"
else
-- a game is in progress but you are in another world.
if mGetLevel(oGame)<>4 then
go frame "GameInProgress"
-- GO TO THE GAME IN PROGRESS IN ANOTHER WORLD SCREEN AND(IF OKNEWGAME)THEN DO BELOW LINES)